import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/vingsoft-acceptance/material/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const allList = (params) => {
    return request({
        url: '/api/vingsoft-acceptance/material/allList',
        method: 'post',
        data: params
    })
}

export const getDetail = (id) => {
  return request({
    url: '/api/vingsoft-acceptance/material/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/vingsoft-acceptance/material/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/vingsoft-acceptance/material/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/vingsoft-acceptance/material/submit',
    method: 'post',
    data: row
  })
};

export const isExistInformPromise = (projectNo) => {
    return request({
        url: '/api/vingsoft-acceptance/material/isExistInformPromise',
        method: 'get',
        params: {
            projectNo
        }
    })
};

export const changeIsCollect = (row) => {
    return request({
        url: '/api/vingsoft-acceptance/material/changeIsCollect',
        method: 'post',
        data: row
    })
};

export const checkMaterStatus = (projectNo, acceptResultCode) => {
    return request({
        url: '/api/vingsoft-acceptance/material/checkMaterStatus',
        method: 'get',
        params: {
            projectNo, acceptResultCode
        }
    })
};